import java.io.FileNotFoundException;
import java.io.PrintStream;
import java.util.Random;
import java.util.concurrent.CountDownLatch;

public class GenerateTestCase
{
	public final static String fs = "d:\\2.txt";

	public static void main(String[] args) throws FileNotFoundException, InterruptedException
	{
		System.setOut(new PrintStream(fs));
		//int total = 10000 * 1000;
		CountDownLatch latch = new CountDownLatch(100);
		CountDownLatch latch2 = new CountDownLatch(100);
		Random random = new Random();
		for(int i = 0; i <100;i++)
		{
			new Thread(new Runnable()
			{
				public void run()
				{
					try
					{
						latch.await();
						System.err.println("start");
						int t = 10000*10;
						while (t != 0)
						{
							int i = random.nextInt(Integer.MAX_VALUE);
							System.out.println(i);
							t--;
						}
						latch2.countDown();
					}
					catch (InterruptedException e)
					{
						e.printStackTrace();
					}
				}
			}).start();
			latch.countDown();
		}
		latch2.await();
		System.err.println("end");
	}
}
